; rdio.inc
; Byte I/O routines for FE3 RAM Disk
;

	.struct FileInfo
		index		.byte		; FileInfo index
		mode		.byte		; I/O mode
		bank		.byte		; current block address (bank or address low)
		addr		.byte		; current block address (address high)
		pos			.byte		; current read/write position
		losize		.byte		; low byte of size for reading
		blocks		.word		; full blocks in file
		dirptr		.word		; current dir ptr
	.endstruct

	IO_MODE_KERNEL = 0
	IO_MODE_READBLOCK = 1
	IO_MODE_READTAIL = 2
	IO_MODE_READEOF = 3
	IO_MODE_READDIR = 4
	IO_MODE_WRITEFIRST = 5
	IO_MODE_WRITENEXT = 6
	IO_MODE_COMMAND = 7
	IO_MODE_REL = 8

.IFDEF _IN_RDIO

	.export io_init
	.export io_setin	
	.export io_setout
	.export io_prepin
	.export io_prepout

	.export io_read 
	.export io_write
	
	.export ioradr
	.export iowadr
	
	.export outinfo
	.export ininfo
	
	.export save_x
	.export save_y
	
	.export writefrst
	.export writenext
	
	.export wr_adr
	
.ELSE

	.import io_init
	.import io_setin	
	.import io_setout
	.import io_prepin
	.import io_prepout

	.import io_read 
	.import io_write
	
	.import ioradr
	.import iowadr

	.import outinfo
	.import ininfo

	.import save_x
	.import save_y

	.import writefrst
	.import writenext

	.import wr_adr

.ENDIF
